package com.shuoyue.ycgk.ui.recruitment.his;

import android.os.Bundle;
import android.widget.TextView;

import com.google.android.material.tabs.TabLayout;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.base.BaseMvpActivity;
import com.shuoyue.ycgk.base.BaseMvpFragment;
import com.shuoyue.ycgk.base.baseadapter.IndexFragmentStateAdapter;
import com.shuoyue.ycgk.ui.mine.order.FragmentOrder;
import com.shuoyue.ycgk.views.viewpager_scroll.SuperViewPager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MyHisActivity extends BaseMvpActivity {
    @BindView(R.id.page_title)
    TextView pageTitle;
    @BindView(R.id.tab_layout)
    TabLayout tabLayout;
    @BindView(R.id.view_pager)
    SuperViewPager viewPager;


    protected IndexFragmentStateAdapter indexFragmentAdapter;
    protected List<BaseMvpFragment> fragmentMainItems;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_simple_tab_viewpager;
    }

    @Override
    protected void initView() {
        pageTitle.setText("我的足迹");
        fragmentMainItems = new ArrayList<>();
        fragmentMainItems.add(FragmentHisNews.getInstance());
        fragmentMainItems.add(FragmentHisJob.getInstance());

        indexFragmentAdapter = new IndexFragmentStateAdapter(getSupportFragmentManager(), fragmentMainItems);
        tabLayout.setupWithViewPager(viewPager);
        viewPager.setOffscreenPageLimit(1);
        viewPager.setAdapter(indexFragmentAdapter);
    }


    @OnClick(R.id.back)
    public void onViewClicked() {
        finish();
    }
}
